<?php

class BaseEvent {
	private $id;
	private $title;
	private $description;
	private $startTime;
	private $endTime;

	public function getId() {
		return $this->id;
	}

	public function getTitle() {
		return $this->title;
	}

	public function getDescription() {
		return $this->description;
	}

	public function getStartDateTime() {
		return $this->startTime;
	}

	public function getEndDateTime() {
		return $this->endTime;
	}

	public function getStartDate() {
		return substr($this->startTime, 0, 10);
	}

	public function getEndDate() {
		return substr($this->endTime, 0, 10);
	}

	public function getStartTime() {
		return substr($this->startTime, 11, 5);
	}

	public function getEndTime() {
		return substr($this->endTime, 11, 5);
	}

	protected function __construct() {
	}

	protected static function create($id, $title, $description, $startTime, $endTime) {
		$self = new BaseEvent();
		$self->id = $id;
		$self->title = $title;
		$self->description = $description;
		$self->startTime = $startTime;
		$self->endTime = $endTime;

		return $self;
	}

	protected static function createFromMetaData($id, $startTime = null, $endTime = null) {
		$self = new BaseEvent();
		$self->id = $id;
		$self->startTime = $startTime;
		$self->endTime = $endTime;

		return $self;
	}

	/*protected function __construct($id) {
		$this->id = $id;
	}

	protected function __construct($id, $startTime, $endTime) {
		$this->id = $id;
		$this->startTime = $startTime;
		$this->endTime = $endTime;
	}

	protected function __construct($id, $title, $description, $startTime, $endTime) {
		$this->id = $id;
		$this->title = $title;
		$this->description = $description;
		$this->startTime = $startTime;
		$this->endTime = $endTime;
	}*/
}